<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vshow-秀出自我</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="description" content="Vshow学生发布平台,提供学生的作品发布">
    <meta name="keywords" content="Vshow,致力于发展为高校的学生作品发布平台">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/Index/reset.css"> 
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/Common/buttons.css"> 
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/Plug/Validation-Engine/validationEngine.jquery.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/script/Plug/artDialog/css/ui-dialog.css">
    <link rel="stylesheet" href="__PUBLIC__/script/Plug/jcrop/css/jquery.Jcrop.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/Index/comment.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/StudentCenter/ucenter.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/style/StudentCenter/dropkick.css">
</head>
<body>
    <include file="Public:head" />

    <div class="ucenter">
        <div class="ucenter-top clearfix">
            <!-- <a href="../../../../Vshow/index.php" class="back fl">返回首页</a> -->
        </div>
        <div class="ucenter-wrap clearfix">
            <div class="ucenter-left">
                <div class="ucenter-l-header clearfix">
                    <img src="__ROOT__/Uploads/Avater/{$Think.session.avaterPath}" alt="">
                    <div class="info">
                        <p class="name">{$user.truename}</p>
                        <!-- <p class="grade">网络1班</p> -->
                    </div>
                </div>
                <ul class="ucenter-l-nav" id="ucenterNav">
                    <li><a class="column1" href="javascript:;">修改资料</a></li>
                    <li><a class="column2" href="javascript:;">课程管理</a></li>
                    <li><a class="column3" href="javascript:;">作业管理</a></li>
                    <li><a class="column4" href="javascript:;">作业管理</a></li>
                    <li><a class="column5" href="javascript:;">我的收藏</a></li>
                </ul>
            </div>
            <div class="ucenter-right" id="ucenterRight">
                <div class="column-box1 r-content">
                    <!-- <a href="javascript:;" class="btn-green">头像修改</a> -->
                    <!-- <a href="javascript:;" class="select-head"></a> -->
                    <volist name="courseList" id="co">
                            <div class="list clearfix">
                            <div class="list-wrap clearfix">
                                <div class="img-wrap fl">
                                    <img src="__ROOT__/Uploads/Course/{$co.course_image}" alt="">
                                </div>
                                <div class="list-cont fl">
                                    <h3>{$co.course_name}</h3>
                                    <span style="float:left;">课程简介：{$co.course_about}</span>
                                </div>                              
                            </div>
                            <p class="fr">
                                <a href="#" class="btn-green fl take-course-button" course-id="{$co.id}">管理课程</a>
                            </p>
                    </div>
                    </volist>
                </div>
                
                <!-- 
                    作品名称：<input type="text" /><br/>
                    作品简介：<input type="text" name="works-about" id="works-about" class="" /><br/>
                    选择作业 <input type="radio" name="is-homework" value="0" checked="checked" />个人作品
                             <input type="radio" name="is-homework" value="1" />课程作业<br/>
                    作品标签：<input type="text" name="works-label"  id="works-label"  /><br/>
                    作品文件：<input type="file" name="works-file" id="works-file" class="validate[required]"/><br/>
                    作品截图：<input type="file" name="works-images" id="works-images" class="validate[required]"/><br/>
                    <input type="submit" value="发布作品">
                 </form> -->
    
               
            </div>      
        </div>
    </div>
    <include file="Public/footer" />
<script type="text/javascript" src="__PUBLIC__/script/Index/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/Index/jquery-color.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/StudentCenter/jquery.dropkick-min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/Plug/Validation-Engine/jquery.validationEngine.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/Plug/Validation-Engine/jquery.validationEngine-zh_CN.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/Plug/artDialog/dist/dialog-min.js"></script>
    <script src="__PUBLIC__/script/Plug/jcrop/js/jquery.Jcrop.js"></script> 
     <script type="text/javascript" src="__PUBLIC__/script/Index/easing.1.3.js" ></script>   
    <script type="text/javascript" src="__PUBLIC__/script/Index/comm.js"></script>
<script type="text/javascript" src="__PUBLIC__/script/Plug/laydate/laydate.dev.js"></script>

    <script type="text/javascript" src="__PUBLIC__/script/StudentCenter/ucenter.js"></script>
    <script type="text/javascript" src="__PUBLIC__/script/StudentCenter/index.js"></script>
    <script type="text/javascript">
        $('#course_add').validationEngine({
            'custom_error_messages':{
                '#course_name' : {
                    'required':{
                        'message' : '* 请输入课程名称'
                    }
                },
                '#course_about': {
                    'required' : {
                        'message': '* 请输入课程简介'
                    }
                }
            },
            'onValidationComplete' : function(form,status){
                if (status === true) {
                    var message = dialog({
                        content: '正在添加课程，请稍等'
                    }).showModal();
                        
                    var data = new FormData();

                    var course_name = document.getElementById('course_name').value;
                    var course_about = document.getElementById('course_about').value;
                    var __hash__ = document.getElementsByName('__hash__')[1].value;
                    var course_image = $("#course_image")[0].files[0];
                    // console.log(__hash__);return false;
                    data.append('course_name',course_name);
                    data.append('course_about',course_about);
                    data.append('course_image',course_image);
                    data.append('__hash__',__hash__);

                    $.ajax({
                           type:"post",
                           url:"/vshow/index.php/Home/TeacherCenter/CourseAddAction",
                           data: data,
                           processData: false,
                           contentType: false
                       }).done(function(res){
                            message.close();
                            if (res.status == 0 ) {
                                D(res.message,'right').showModal();
                            }else{
                                var resMessage = dialog({
                                    title : '提示',
                                    content : res.message,
                                    width : 347,
                                    height: 180,
                                    okValue:'确定',
                                    cancelValue :'取消',
                                    ok:function(){
                                        this.close();
                                        location.href = location.href;
                                    },
                                    cancel:function(){
                                        this.close();
                                        location.href = location.href;
                                    }
                                });
                                resMessage.showModal();
                            }
                     });
                }
            },
            // 'ajaxFormValidation' : true,
            'ajaxFormValidationMethod' : 'post'
    }); 
    laydate({
            elem: '#homework_expires'
        });
    </script>
</body>
</html>